﻿package plugin.roleN.compoment
{
    import com.sh.game.consts.*;
    import com.sh.game.global.*;
    import uiresource.roleui.*;

    public class FashionItemCtrl extends FashionItemUI
    {
        private var cfgFashion:Array;
        private var cfgItem:Object;
        private var _data:Object;

        public function FashionItemCtrl()
        {
            this.cfgFashion = ConfigDictionary.data.fashion;
            this.cfgItem = ConfigDictionary.data.item;
            return;
        }// end function

        public function get data() : Object
        {
            return this._data;
        }// end function

        public function set data(param1:Object) : void
        {
            var _loc_2:Object = null;
            var _loc_3:int = 0;
            this.clear();
            this._data = param1;
            if (param1.fashionType == 6)
            {
                _loc_2 = ConfigDictionary.data.horse;
                nameimg.url = Config.getUrl("assets/images/fashion/" + this.cfgFashion[param1.fashionId].model + ".png", ResourceType.NORMAL);
            }
            else
            {
                _loc_3 = param1.model[0];
                nameimg.url = Config.getUrl("assets/images/fashion/" + String(_loc_3) + ".png", ResourceType.NORMAL);
            }
            head.url = Config.getUrl("assets/images/icon/tools/" + this.cfgItem[int(this.cfgFashion[param1.fashionId].item)].icon + ".png", ResourceType.NORMAL);
            huodeLabel.text = "<font color=\'#53b436\'>（已获得）</font>";
            head.filters = null;
            var _loc_4:Boolean = true;
            nameimg.visible = true;
            head.visible = _loc_4;
            if (param1.display == 0)
            {
                useimg.visible = false;
            }
            else
            {
                useimg.visible = true;
            }
            return;
        }// end function

        public function clear() : void
        {
            head.url = null;
            head.visible = false;
            nameimg.url = null;
            nameimg.visible = false;
            return;
        }// end function

    }
}
